package com.example.service;

import com.example.entity.User;
import com.example.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;


@Service

public class UserServiceImpl implements UserService{

    @Autowired
    UserMapper userMapper;

    @Transactional
    @Override
    public Integer save(User user){
        return userMapper.insert(user);
    }

    @Transactional(propagation = Propagation.NOT_SUPPORTED)
    @Override
    public User detail(int id){
        return userMapper.detail(id);
    }
}
